]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
MessageTray: fix reentrancy problem in hideNotificationCompleted
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 22 Dec 2012 15:02:19 +0000 (16:02 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 28 Jan 2013 20:02:45 +0000 (21:02 +0100)
Hiding notificationWidget with a telepathy notification causes
unfocused to be emitted, which causes a reentrant updateState.
If another notification is queued, it is shown before the old
one is cleared.

https://bugzilla.gnome.org/show_bug.cgi?id=683986

js/ui/messageTray.js

index 44d884fe591187229e6d34d8ac78017a4600cc14..861f32588f06d282b8a2cddd733bc4a7ac6e4b94 100644 (file)
@@ -2270,7 +2270,7 @@ const MessageTray = new Lang.Class({
 
         this._notificationClickedId = this._notification.connect('done-displaying',
                                                                  Lang.bind(this, this._escapeTray));
-        this._notification.connect('unfocused', Lang.bind(this, function() {
+        this._notificationUnfocusedId = this._notification.connect('unfocused', Lang.bind(this, function() {
             this._updateState();
         }));
         this._notificationBin.child = this._notification.actor;
@@ -2410,19 +2410,22 @@ const MessageTray = new Lang.Class({
     },
 
     _hideNotificationCompleted: function() {
-        this._notificationRemoved = false;
-        this._notificationWidget.hide();
-        this._closeButton.hide();
-        this._pointerInTray = false;
-        this.actor.hover = false; // Clutter doesn't emit notify::hover when actors move
-        this._notificationBin.child = null;
         this._notification.collapseCompleted();
         this._notification.disconnect(this._notificationClickedId);
         this._notificationClickedId = 0;
+        this._notification.disconnect(this._notificationUnfocusedId);
+        this._notificationUnfocusedId = 0;
         let notification = this._notification;
         this._notification = null;
         if (notification.isTransient)
             notification.destroy(NotificationDestroyedReason.EXPIRED);
+
+        this._notificationRemoved = false;
+        this._closeButton.hide();
+        this._pointerInTray = false;
+        this.actor.hover = false; // Clutter doesn't emit notify::hover when actors move
+        this._notificationBin.child = null;
+        this._notificationWidget.hide();
     },
 
     _expandActiveNotification: function() {